'use strict'
let express = require('express');
let app = express();

let index = require('./controllers/index');
let user = require('./controllers/user');
let teacher = require('./controllers/teacher');
let login = require('./controllers/login');



// 指定模板引擎-存放
app.set('views','./views');
// 指定模板引擎
app.set('view engine','xtpl');

//路由-挂载路由
app.use('/',index);
app.use('/user',user);
app.use('/teacher',teacher);
app.use('/login',login);

//设置静态目录
app.use('/public',express.static('public'));
app.use('/uploads',express.static('uploads'));

app.listen(3001,function(){
    console.log('服务器启动成功');
})